﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title><%= web_title%></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/ruoling/theme/ruoling-theme-white.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="/libs/animate/animate.css">
    <link rel="stylesheet" href="/ruoling/theme/ruoling-theme-white.css" media="all">
</head>
<style>
    .ruoling-tab-item{
        border: 1px solid #9F9F9F;
        height: 26px !important;
        line-height: 26px !important;
        font-size: 12px !important;
        margin-left: 5px;
        margin-right: 5px;
        border-right:1px solid #9F9F9F !important;
        padding:0 5px !important;
        padding-right: 30px !important;
    }
    .layui-tab-title{
        line-height: 40px;
        display: inline-block;
    }
    .layui-this{
        background-color: #42b983 !important;
        border-color: #42b983;
        color: #FFFFFF !important;
    }
    .ruoling-tab-item:after{
        position: inherit !important;
    }
    .layui-this:after{
        position: inherit !important;
    }
    .ruoling-this{

    }
    .ruoling-this span:before{
        content: "";
        background-color: #FFFFFF;
        width: 8px;
        height: 8px;
        display: inline-block;
        vertical-align: middle;
        border-radius: 50%;
        margin-bottom: 3px;
        margin-right: 4px;
    }
    .ruoling-menu-animate{
        transition:all 2s ease;
    }
</style>
<body class="layui-layout-body">
    <div id="LAY_app">
        <div class="layui-layout layui-layout-admin">
            <!--  头部菜单  -->
            <div class="layui-header">
                <!-- 头部区域 -->
                <ul class="layui-nav layui-layout-left">
                    <li class="layui-nav-item layadmin-flexible" lay-unselect>
                        <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
                            <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
                        </a>
                    </li>
                </ul>
                <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
<!--                    <li class="layui-nav-item" lay-unselect>-->
<!--                        <a lay-href="app/message/index.html" layadmin-event="message" lay-text="消息中心">-->
<!--                            <i class="layui-icon layui-icon-notice"></i>-->
<!--                            &lt;!&ndash; 如果有新消息，则显示小圆点 &ndash;&gt;-->
<!--                            <span class="layui-badge-dot"></span>-->
<!--                        </a>-->
<!--                    </li>-->
<!--                    <li class="layui-nav-item layui-hide-xs" lay-unselect>-->
<!--                        <a href="javascript:;" layadmin-event="theme">-->
<!--                            <i class="layui-icon layui-icon-theme"></i>-->
<!--                        </a>-->
<!--                    </li>-->
                    <li class="layui-nav-item layui-hide-xs" lay-unselect>
                        <a href="javascript:;" >
                            <i class="layui-icon layui-icon-light"></i>
                        </a>
                    </li>
<!--                    <li class="layui-nav-item layui-hide-xs" lay-unselect>-->
<!--                        <a href="javascript:;" layadmin-event="note">-->
<!--                            <i class="layui-icon layui-icon-note"></i>-->
<!--                        </a>-->
<!--                    </li>-->
                    <li class="layui-nav-item layui-hide-xs" lay-unselect>
                        <a href="javascript:;" layadmin-event="fullscreen">
                            <i class="layui-icon layui-icon-screen-full"></i>
                        </a>
                    </li>
                    <li class="layui-nav-item" lay-unselect>
                        <a href="javascript:;">
                            <cite><%= user.sys_loginname %></cite>
                        </a>
                        <dl class="layui-nav-child">
<!--                            <dd><a lay-href="set/user/info.html">基本资料</a></dd>-->
<!--                            <dd><a lay-href="set/user/password.html">修改密码</a></dd>-->
<!--                            <hr>-->
                            <dd id="logout" style="text-align: center;"><a>退出</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
            <!-- 侧边菜单 -->
            <div class="layui-side layui-side-menu">
                <div class="layui-side-scroll">
<!--                    layui-logo-->
                    <div class="" style="margin-left: -40px" lay-href="home/console.html">
                        <span>ruoling</span>
                    </div>
                    <ul class="layui-nav layui-nav-tree " lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
                        <!-- layui-nav-itemed  -->
                        <%_ for(var i = 0;i<data.length;i++){_%>

                            <%if(data[i].sys_parent_id == 1 && data[i].sys_type == "menu"){%>
                                <li data-name="home" class="layui-nav-item">
                                    <a href="javascript:;" lay-tips="<%= data[i].sys_menu_name %>" lay-direction="2">
                                        <i class="layui-icon layui-icon-home"></i>
                                        <cite><%= data[i].sys_menu_name%></cite>
                                    </a>
                                    <dl class="layui-nav-child">
                                        <%_ for(var n = 0;n<data.length;n++){_%>
                                            <%_ if(data[n].sys_parent_id == data[i].ID && data[n].sys_type == "menu"){_%>
                                                <dd data-name="console">
                                                    <a href='<%= data[n].sys_permission_url%>' onclick="MenuOn('<%= data[n].sys_permission_url%>'); return false;"  lay-href="<%= data[n].sys_permission_url%>"><%= data[n].sys_menu_name%></a>
                                                </dd>
                                            <%_}_%>
                                        <%_}_%>
                                    </dl>
                                </li>
                            <%}%>
                        <%_}_%>
                      <!--  <li data-name="home" class="layui-nav-item layui-nav-itemed">
                            <a href="javascript:;" lay-tips="主页" lay-direction="2">
                                <i class="layui-icon layui-icon-home"></i>
                                <cite>主页</cite>
                            </a>
                            <dl class="layui-nav-child">
                                <dd data-name="console" class="layui-this">
                                    <a lay-href="home/console.html">控制台</a>
                                </dd>
                                <dd data-name="console">
                                    <a lay-href="home/homepage1.html">主页一</a>
                                </dd>
                                <dd data-name="console">
                                    <a lay-href="home/homepage2.html">主页二</a>
                                </dd>
                            </dl>
                        </li>
                        -->
                    </ul>
                </div>
            </div>
            <!-- 页面标签 -->
            <div class="layadmin-pagetabs" id="LAY_app_tabs">
                <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
                <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
                <div class="layui-icon layadmin-tabs-control layui-icon-down">
                    <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
                        <li class="layui-nav-item" lay-unselect>
                            <a href="javascript:;"></a>
                            <dl class="layui-nav-child layui-anim-fadein">
                                <dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前标签页</a></dd>
                                <dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd>
                                <dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部标签页</a></dd>
                            </dl>
                        </li>
                    </ul>
                </div>
                <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
                    <ul class="layui-tab-title" id="LAY_app_tabsheader">
                        <li style=" padding-right:5px !important;"  class="ruoling-tab-item"><span>首页</span></li>
                    </ul>
                </div>
            </div>
            <!-- 主体内容 -->
            <div class="layui-body" id="LAY_app_body">
                <div class="layadmin-tabsbody-item layui-show" >
                    <iframe  src="home/console.html" frameborder="0" id="Iframepath"  class="animated fadeInLeft layadmin-iframe"></iframe>
                </div>
            </div>
            <!-- 辅助元素，一般用于移动设备下遮罩 -->
            <div class="layadmin-body-shade" layadmin-event="shade"></div>
        </div>
    </div>

<script src="/layuiadmin/layui/layui.js"></script>

<script>
    function into() {
        let Iframepath = document.querySelector("#Iframepath");
        let LAY_system_side_menu = document.querySelector("#LAY-system-side-menu");
        let LAY_children = LAY_system_side_menu.children;
        if (Iframepath != null) {
            //解决每次刷新 回到原点页面
            Iframepath.src = Getstorage();

            for (let i = 0; i < LAY_children.length; i++) {
                let LAY_dd = LAY_children[i].querySelector("dl").querySelectorAll("dd");
                //解决每次刷新左侧菜单不聚焦在特定的页面
                for (let n = 0; n < LAY_dd.length; n++) {
                    let LAY_a = LAY_dd[n].querySelector("a");
                    let lay_href = LAY_a.getAttribute("lay-href");
                    if (Getstorage() == lay_href) {
                        LAY_dd[n].className = "layui-this"
                    }
                }
            }
        }
    };
    into();

    function MenuOn(value) {
        Setstorage(value)
        return false
    };

    function Setstorage(value){
        localStorage.setItem("publicPath", value);
    };

    function Getstorage(value) {
        let publicPath = localStorage.getItem("publicPath");
        return publicPath;
    };

    document.querySelector("#logout").addEventListener("click",function(){
        layer.confirm('确定注销并退出系统吗？', {icon: 3, title:'提示'}, function(index){
            location.href = "/admin/v1/api/logout"
            layer.close(index);
        });


    })
</script>
<script>
layui.config({
    base:"/layuiadmin/"
}).extend({
    index:"lib/index",
}).use(['index'],function(){
    const Index = layui.index;
});
</script>
</body>
</html>


